<?php 
define('PAGE_NEED_PRI','PRI_ADMIN');
session_start();include "conn.php";
include_once "main.php";
?>
<?php  include("admin.php");?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> Bios 管理中心 </title>
<link href="../css/control.css" rel="stylesheet" type="text/css" />
</head>

<body>

<a name="top" id="top"></a>
<div id="all"><!--Wrap start //-->
<div id="main" class="clearfix"><!--main start //-->
<div id="top-1"><?php include_once('blog_top_btn.php');?>
</div>
<!--Content for  id "submenu" Goes Here //-->
<div id="submenu">
<?php include_once('admin_main_btn.php');?>
  </div>
 <!--Content for  id "contact" Goes Here //-->
 <div id="contact">


<?php 
//修改数据
$id=make_safe($_GET["id"]);
$action=make_safe($_GET["action"]);
$username=make_safe($_GET["username"]);
$password=make_safe($_POST["password"]);
$name=make_safe($_POST["name"]);
$tel=make_safe($_POST["tel"]);
$email=make_safe($_POST["email"]);
$msn=make_safe($_POST["msn"]);
$address=make_safe($_POST["address"]);

include("check.php");
if($action=="xiugai"){

if($password==""){
echo"SORRY <br>";
echo"请输入管理員密碼!<a href='javascript:history.go(-1)'>返回重输</a><br>";
}

if($id!="" and $password!=""){

if($query=mysql_query("update guanli set password='$password',name='$name',tel='$tel',email='$email',msn='$msn',address='$address' where id='$id'"))

{
if($_SESSION["box11"]==1 ){
   echo "<script>alert('資料修改成功！');window.location.href='admin-acc-s-main.php';</script>";
   }else{
    echo "<script>alert('資料修改成功！');window.location.href='admin-acc-s-main.php?id=".$id."';</script>";
	}
 }
 
 else
  {
  
  
  if($_SESSION["box11"]==1){
   echo "<script>alert('資料修改失敗！');window.location.href='admin-acc-s-main.php';</script>";
      }else{
   echo "<script>alert('資料修改失敗！');window.location.href='admin-acc-s-main.php?id=".$id."';</script>";
   }
   
  }
  }
   }


?>







<table width="98%" border="0" >
  <tr>
    <td>個人賬號管理 - 管理員管理 - 修改密碼 </td>
  </tr>
</table></br>

        
<form name="form1" action="?action=xiugai&id=<?php echo $id;?>" method="post" >
              <table width="98%" border="1" cellpadding="0" cellspacing="0" bgcolor="#000000" >
              
<?php 
    $sql="select * from guanli where id='$id' ";	
	$result=mysql_query($sql);
	while ($row=mysql_fetch_array($result)){
	?>
	
	
	 <tr > 
     <td width="28%" height="25" > 
                  <div align="center">管理員帳號：</div></td>
                  <td width="28%" > 
                  <div align="center"><?php echo $row["username"];?></div></td>
                  <td width="24%" > 
                  <div align="center">操作</div></td>
                </tr>
	
	
	
	
	
	
	
                <tr > 
                  <td height="22" > 
                    <div align="center">管理員密碼：
                    
                  </div></td>
                  <td > 
                    <div align="center">
                      <input type="text" name="password" value="<?php echo $row["password"];?>">
                  </div></td>
                  <td > 
				  </td>
                </tr>
				
				
				
				 <tr > 
                  <td height="22" > 
                    <div align="center">
                     姓名：
                  </div></td>
                  <td > 
                    <div align="center">
                      <input type="text" name="name" value="<?php echo $row["name"];?>">
                  </div></td>
                  <td > 
				  </td>
                </tr>
				
				
				
				
				
				 <tr > 
                  <td height="22" > 
                    <div align="center">
                     郵件：
                  </div></td>
                  <td > 
                    <div align="center">
                      <input type="text" name="email" value="<?php echo $row["email"];?>">
                  </div></td>
                  <td > 
                </td>
                </tr>
				
				
				
				<tr > 
                  <td height="22" > 
                    <div align="center">
                     MSN：
                  </div></td>
                  <td > 
                    <div align="center">
                      <input type="text" name="msn" value="<?php echo $row["msn"];?>">
                  </div></td>
                  <td > 
                </td>
                </tr>
				
				
				 <tr > 
                  <td height="22" > 
                    <div align="center">
                     電話：
                  </div></td>
                  <td > 
                    <div align="center">
                      <input type="text" name="tel" value="<?php echo $row["tel"];?>">
                  </div></td>
                  <td >
				  </td>
                </tr>
				
				
				
				
				 <tr > 
                  <td height="22" > 
                    <div align="center">
                     個人網址：
                  </div></td>
                  <td > 
                    <div align="center">
                      <input type="text" name="address" value="<?php echo $row["address"];?>">
                  </div></td>
                  <td > 
                    <div align="center">
                      
                      <input type="submit" name="submit" value="修改">
</div></td>
                </tr>
				
				
<?php }?>
  </table>
</form>









   

   
   
   
   
   
 </div>
  <!--Content for  id "contact_page" Goes Here //-->
  
</div><!-- main end //-->
</div><!--Wrap end //-->
<div id="botton">
 <?php include_once('admin_botton_btn.php');?>
</div>

<script language="javascript">
<!--

function ConfirmDel()
{
   if(confirm("確定要刪除選擇的項目嗎？一旦刪除將不能恢複！"))
     return true;
   else
     return false;	 
}


</SCRIPT>

<script language="javascript">
	function check(form1){
		if(form1.username.value==""){
			alert("请输入管理員帳號!");form1.username.focus();return false;		
		}
		if(form1.password.value==""){
			alert("请输入管理員密碼!");form1.password.focus();return false;
		}
		
		if(form1.password.value!=form1.conpassword.value){
			alert("對不起，您輸入的確認密碼不正確!");form1.conpassword.focus();return false;
		}
	}
</script>



</body>
</html>
